<h1>เว็บไซต์ที่เกี่ยวข้อง</h1>
<?php echo $weblinks->pagination()?>
<table class="list">
	<tr>
		<th>แสดง</th>
		<th>รูปภาพ</th>
		<th>URL</th>
		<th>โดย</th>
		<th width="90"><a class="btn" href="weblinks/admin/weblinks/form<?php if(!empty($_GET['agency_id'])) echo '?agency_id='.$_GET['agency_id']; ?>" class="tiny">เพิ่มรายการ</a></th>
	</tr>
	<?php foreach($weblinks as $weblink): ?>
	<tr <?php echo cycle()?>>
		<td><input type="checkbox" name="status" value="<?php echo $weblink->id ?>" <?php echo ($weblink->status=="approve")?'checked="checked"':'' ?>  /></td>
		<td><img class="img" style="width:176px; height:58px;" src="<?php echo (is_file('uploads/weblink/'.$weblink->image))? 'uploads/weblink/'.$weblink->image : 'media/images/dummy/176x58.gif' ?>"  /></td>
		<td><?php echo $weblink->url?></td>
		<td><?php echo $weblink->user->fullname?></td>
		<td>
			<a class="btn" href="weblinks/admin/weblinks/form/<?php echo $weblink->id?><?php if(!empty($_GET['agency_id'])) echo '?agency_id='.$_GET['agency_id']; ?>" >แก้ไข</a>
			<a class="btn" href="weblinks/admin/weblinks/delete/<?php echo $weblink->id?><?php if(!empty($_GET['agency_id'])) echo '?agency_id='.$_GET['agency_id']; ?>" onclick="return confirm('ยืนยันการลบ')">ลบ</a>
		</td>
	</tr>
	<?php endforeach; ?>
</table>
<?php echo $weblinks->pagination()?>